package com.shj.em.biz.company.service;

import com.shj.em.biz.company.entity.CustomSell;
import com.shj.em.biz.company.mapper.CustomSellMapper;
import com.shj.em.biz.company.service.CustomSellService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.plugins.Page;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;


/**
 * 等级金额表 服务实现类
 *
 * @author Shen Huang Jian
 * @since 2018-10-17
 */
@Service
@Transactional
public class CustomSellServiceImpl extends ServiceImpl<CustomSellMapper, CustomSell> implements CustomSellService {

    @Autowired
    CustomSellMapper customsellMapper;

    public Page<CustomSell> queryCustomSellPage(Map<String, Object> params){
        int offset = (Integer)params.get("offset");
        int pageSize = (Integer)params.get("limit");
        int pageNo = offset / pageSize + 1;
        Page<CustomSell> page = new Page(pageNo, pageSize);
        List<CustomSell> list = customsellMapper.queryCustomSellPage(page, params);
        return page.setRecords(list);
    }
}
